package com.cqc.jdk8.Jutil.concurrent.locks.ReentrantLock.Condition;


public class ThreadTest {
    /**
     * 日志：
     * await() start...Thread-0
     * signal() start...Thread-1
     * signal() end...Thread-1
     * await() end...Thread-0
     *
     * 我们看到 AThread 进入等待状态，然后 BThread 唤醒了 AThread，然后 AThread 结束。
     * 说明 Condition.await()也是释放锁的
     */
    public static void main(String[] args) throws InterruptedException {
        Counter counter = new Counter();
        AThread aThread = new AThread(counter);
        aThread.start();

        BThread bThread = new BThread(counter);
        bThread.start();
    }
}
